package com.ericsson.enap.modules.procLog.job;

import com.ericsson.common.quartz.job.MainJob;
import com.ericsson.common.quartz.job.ManualQuartzJob;
import com.ericsson.common.quartz.service.QuartzTableManager;
import com.ericsson.common.util.LogFileName;
import com.ericsson.common.util.LoggerUtils;
import com.ericsson.enap.modules.procLog.task.ProcLogTask;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @description: procLog功能job
 * @author: wangjingshi
 * @create: 2021-05-06 09:28
 */
@Component
public class ProcLogJob implements MainJob  {

    private Logger log = LoggerUtils.Logger(LogFileName.ProcLogJob);

    @Autowired
    private QuartzTableManager quartzTableManager;
    @Autowired
    private ProcLogTask procLogTask;



    @Override
    public void doTask() {
        log.info("===== do ProcLogJob start =====");
        //procLogTask.execute();
        //定时任务每天早上7点执行一次
        quartzTableManager.addManualTaskJob("ProcLogTask","ProcLogTask",
                "ProcLogTask","ProcLogTask",
                ManualQuartzJob.class,"0 0/5 * * * ?",procLogTask);
    }
}
